import { lazy } from 'react'
import {Navigate} from 'react-router-dom'
//一级路由
var Login = lazy(()=>import('../view/Login/Login'))
var NotFound = lazy(()=>import('../view/Notfind/Notfind'))
var Index = lazy(()=>import('../view/Index/Index'))

//二级路由
var Head = lazy(()=>import('../view/Index/head/Head'))

var Teacherlist = lazy(()=>import('../view/Index/teacher/Teacherlist'))
var Teacheradd = lazy(()=>import('../view/Index/teacher/Teacheradd'))
var Teacherjs = lazy(()=>import('../view/Index/teacher/Teacherjs'))

var Student = lazy(()=>import('../view/Index/student/Student'))
var Studentlook=lazy(()=>import('../view/Index/student/studentlook'))
var Studentadd = lazy(()=>import('../view/Index/student/Studentadd'))
var Studentxq = lazy(()=>import('../view/Index/student/Studentxq'))
var Studentcj = lazy(()=>import('../view/Index/student/Studentcj'))
var Studentcjadd = lazy(()=>import('../view/Index/student/Studentcjadd'))
var Course = lazy(()=>import('../view/Index/course/Course'))
var Courseadd = lazy(()=>import('../view/Index/course/Courseadd'))
var Coursejs = lazy(()=>import('../view/Index/course/Coursejs'))

var Libary = lazy(()=>import('../view/Index/library/Libary'))
var Libaryadd = lazy(()=>import('../view/Index/library/Libaryadd'))

//配置路由表
export default [
    {
        path:'/index',
        element: <Index/>,
        children:[
            {
                path:'/index/head',
                element:<Head></Head>
            },
            {
                path:'/index/teacherlist',
                element:<Teacherlist></Teacherlist>
            },
            {
                path:'/index/teacheradd',
                element:<Teacheradd></Teacheradd>
            },

            {
                path:'/index/teacherjs',
                element:<Teacherjs></Teacherjs>
            },
            {
                path:'/index/student',
                element:<Student></Student>
            },
            {
                path:'/index/studentlook',
                element:<Studentlook></Studentlook>
            },
            {
                path:'/index/studentadd',
                element:<Studentadd></Studentadd>
            },
            {
                path:'/index/studentxq',
                element:<Studentxq></Studentxq>
            },
            {
                path:'/index/studentcj',
                element:<Studentcj></Studentcj>
            },
            {
                path:'/index/studentcjadd',
                element:<Studentcjadd></Studentcjadd>
            },
            {
                path:'/index/course',
                element:<Course></Course>
            },
            {
                path:'/index/courseadd',
                element:<Courseadd></Courseadd>
            },
            {
                path:'/index/coursejs',
                element:<Coursejs></Coursejs>
            },
            {
                path:'/index/libary',
                element:<Libary></Libary>
            },
            {
                path:'/index/libaryadd',
                element:<Libaryadd></Libaryadd>
            },
            {
                path:'/index',
                element:<Navigate to='/index/head'></Navigate>
            },
            {
                path:'*',
                element: <NotFound />
            },
        ]
       
    },
    {
        path:'/login',
        element: <Login />
    },
    {
        path:'/',
        element: <Navigate to='/index' />
    },
    {
        path:'*',
        element: <NotFound />
    },
]